package day20180608.abc;

import java.lang.reflect.InvocationTargetException;

import static org.junit.Assert.assertEquals;

public class Test {
    @org.junit.Test
    public void testHello() throws IllegalArgumentException,
            IllegalAccessException, InvocationTargetException,
            SecurityException, NoSuchMethodException, InstantiationException {

        //定义操作类
        ParamNotNullHandle parse = new ParamNotNullHandle();

        //假设我们知道类HelloWorldStub使用了注解，执行HelloWorldStub中带注解的方法
        //判断是否使用了注解的name()方法，设置name = "小明"，并返回"小明 say hello world!"
        //String returnValue = parse.parseMethod(HelloWorldStub.class);


        //System.out.println(returnValue);
        //assertEquals("小明 say hello world!", returnValue) ;

        HelloWorldStub helloWorldStub=new HelloWorldStub();

        Class c=helloWorldStub.getClass();
        parse.paramterM(  c.getMethod("sayHello",String.class));

    }
}
